package com.changjiang.luban.dao.sys;

import com.changjiang.luban.dao.domain.sys.SysLog;
import com.changjiang.luban.utils.dao.BaseDao;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * LogDao
 * Description:
 *
 * @author tengchenglong
 * @version v0.1
 * @date 2018/6/19-10:54
 */
@Repository
public interface LogDao extends BaseDao<SysLog,Long> {

    /**
     * 删除日志信息
     * @param type
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    @Modifying
    @Query("delete from SysLog   where  type = :type ")
    Integer deleteByType(@Param("type") Integer type);


}
